//
//  DPAsyncTestsRunner.h
//  UITestingKit
//
//  Created by Ofri Wolfus on 09/02/07.
//  Copyright 2007 Ofri Wolfus. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import <UITestingKit/DPRunLoopSource.h>
#import <UITestingKit/DPTestStatistics.h>
#import <UITestingKit/DPTestsModule.h>

@interface DPAsyncTestsRunner : DPRunLoopSource {
	NSMutableArray *modules, *finishedModules;
	id currentModule;
	id delegate;
	BOOL catchExceptions;
	BOOL stopOnFailure;
	BOOL isVerbose;
	unsigned completeCount, modulesCount;
}

- (id)initWithModules:(NSArray *)arr;

- (BOOL)stopsOnFailedTests;
- (void)setStopsOnFailedTests:(BOOL)flag;

- (BOOL)catchExceptions;
- (void)setCatchExceptions:(BOOL)flag;

- (void)setDelegate:(id)delegate;
- (id)delegate;

- (BOOL)isVerbose;
- (void)setIsVerbose:(BOOL)flag;

// Returns a printable (human readable) log
- (NSString *)log;

@end

@interface NSObject (DPAsyncTestsRunnerDelegate)
- (void)testsRunner:(DPAsyncTestsRunner *)runner reportedFailedTest:(DPTestStatistics *)stats;
- (void)testsRunnerFinished:(DPAsyncTestsRunner *)runner withStatus:(DPTestStatus)stats;
@end
